<?php
require_once 'modules/eventManager/models/resources/Event/Interface.php';
require_once 'modules/eventManager/models/resources/Event/Item/Interface.php';

class EventManager_Resource_EventTest extends PHPUnit_Framework_TestCase implements EventManager_Resource_Event_Interface
{
    protected $_rowset = null;
    protected $_mockRow = null;
    
    public function __construct()
    {       
        $data = array();
        for($i=0; $i<10; $i++) {
            $mock = $this->getMock('EventManager_Resource_Event_Item_Interface');
            
            // mock the item calls
            $mock->expects($this->any())
                 ->method('getImages')
                 ->will($this->returnValue(array(true)));
            
            $mock->evt_id = $i;
            $mock->evt_name = 'Product ' . $i;
            $mock->evt_description = str_repeat('Product ' . $i . ' is great..', 10);
            $mock->evt_startdate = '01-01-2010';
            $mock->evt_enddate = '01-12-2010';
            $mock->end_amtpersons = $i;
            $data[] = $mock;
        }

        $this->_rowset = $data;
    }
    
    public function getEventById($id)
    {
        $this->assertNotEquals(0, $id, 'Assertion failed in ' . __CLASS__);
        
        foreach ($this->_rowset as $event) {
            if($event->evt_id == $id) {
                return $event;
            }
        }
        
        return false;
    }
    
    public function getAllEvents($startdate =null, $enddate =null,$paged)
    {
    	
    }
    public function saveEvent($info)
    {
        return true;
    }
}